package com.demo.config;

import com.demo.interceptor.JwtToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class webMVCconfig extends WebMvcConfigurationSupport {

    @Autowired
    JwtToken jwtToken;
    protected void addInterceptors(InterceptorRegistry registry) {
       // log.info("开始注册自定义拦截器...");
        registry.addInterceptor(jwtToken)
                .addPathPatterns("/user/**")
                .addPathPatterns("/Company/**")
                .excludePathPatterns("/Company/login")
                .excludePathPatterns("/user/login")
                .excludePathPatterns("/user/register");
    }
}
